#include <bits/stdc++.h>
using namespace std;
int a[10010], n;
void del()
{
	int a[n] = -1;
	n--;
	for(int i = 1; i <= n; i++)
		cout << a[i] << " ";
	puts("");
}
void pl(int x)
{
	for(int i = n + 1; i >= 1; i--)
		a[i] = a[i-1];
	n++;
	a[1] = x;
	for(int i = 1; i <= n; i++)
		cout << a[i] << " ";
	puts("");
}
int main()
{
	cout << "1 删除 2 添加";
	while(1)
	{
		int d;
		cin >> d;
		if(d == 1)
			del();
		if(d == 2)
		{
			int u;
			cin >> u;
			pl(u);
		}
	}
	return 0;
}